package com.ruoyi.swap.openapi.Kline.service.impl;

import java.util.List;

import com.ruoyi.swap.openapi.Kline.domain.VO.SwapOpenapiKlineVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.swap.openapi.Kline.mapper.SwapOpenapiKlineMapper;
import com.ruoyi.swap.openapi.Kline.domain.SwapOpenapiKline;
import com.ruoyi.swap.openapi.Kline.service.ISwapOpenapiKlineService;

/**
 * K线/蜡烛图Service业务层处理
 * 
 * @author saumell
 * @date 2024-08-19
 */
@Service
public class SwapOpenapiKlineServiceImpl implements ISwapOpenapiKlineService 
{
    @Autowired
    private SwapOpenapiKlineMapper swapOpenapiKlineMapper;

    /**
     * 查询K线/蜡烛图
     * 
     * @param id K线/蜡烛图主键
     * @return K线/蜡烛图
     */
    @Override
    public SwapOpenapiKlineVO selectSwapOpenapiKlineById(Integer id)
    {
        return swapOpenapiKlineMapper.selectSwapOpenapiKlineById(id);
    }

    /**
     * 查询K线/蜡烛图列表
     * 
     * @param swapOpenapiKline K线/蜡烛图
     * @return K线/蜡烛图
     */
    @Override
    public List<SwapOpenapiKlineVO> selectSwapOpenapiKlineList(SwapOpenapiKlineVO swapOpenapiKline)
    {
        return swapOpenapiKlineMapper.selectSwapOpenapiKlineList(swapOpenapiKline);
    }

    @Override
    public List<SwapOpenapiKlineVO> selectSwapAllData() {
        return swapOpenapiKlineMapper.selectSwapAllData();
    }

    @Override
    public Integer queryCurryNumber(String currencyPair) {
        return swapOpenapiKlineMapper.queryCurryNumber(currencyPair);
    }

    @Override
    public Integer selectLatestIdByApiCurrencyPair(String apiCurrencyPair) {
        return swapOpenapiKlineMapper.selectLatestIdByApiCurrencyPair(apiCurrencyPair);
    }

    @Override
    public int incrementFailById(Integer id, java.util.Date lastExecutionTime, String callingState, String lastFailureReason) {
        return swapOpenapiKlineMapper.incrementFailById(id, lastExecutionTime, callingState, lastFailureReason);
    }

    @Override
    public int incrementSuccessById(Integer id, java.util.Date lastExecutionTime, String callingState) {
        return swapOpenapiKlineMapper.incrementSuccessById(id, lastExecutionTime, callingState);
    }

    /**
     * 新增K线/蜡烛图
     * 
     * @param swapOpenapiKline K线/蜡烛图
     * @return 结果
     */
    @Override
    public int insertSwapOpenapiKline(SwapOpenapiKline swapOpenapiKline)
    {
        return swapOpenapiKlineMapper.insertSwapOpenapiKline(swapOpenapiKline);
    }

    /**
     * 修改K线/蜡烛图
     * 
     * @param swapOpenapiKline K线/蜡烛图
     * @return 结果
     */
    @Override
    public int updateSwapOpenapiKline(SwapOpenapiKline swapOpenapiKline)
    {
        return swapOpenapiKlineMapper.updateSwapOpenapiKline(swapOpenapiKline);
    }

    /**
     * 批量删除K线/蜡烛图
     * 
     * @param ids 需要删除的K线/蜡烛图主键集合
     * @return 结果
     */
    @Override
    public int deleteSwapOpenapiKlineByIds(Integer[] ids)
    {
        return swapOpenapiKlineMapper.deleteSwapOpenapiKlineByIds(ids);
    }

    /**
     * 删除K线/蜡烛图信息
     * 
     * @param id K线/蜡烛图主键
     * @return 结果
     */
    @Override
    public int deleteSwapOpenapiKlineById(Integer id)
    {
        return swapOpenapiKlineMapper.deleteSwapOpenapiKlineById(id);
    }
}
